<template>
  <!-- 手工抄表 -->
  <div class="flManualReading">
    <!-- 搜索框-->
    <div style="padding: 0px 0px">
      <div style="font-weight: 700; padding: 10px 10px 10px 50px">
        手工抄表--作废
      </div>
      <div style="border-top: 1px solid #e6e6e6; margin: 0px 20px"></div>
      <searchComponents :searchData="searchData" :optionsZi="optionsZi" :searchOptionTable="searchOptionTable" @searchCallBack="searchCallBack"></searchComponents>
      <div style="border-top: 1px solid #e6e6e6"></div>
      <div class="right_row">
        <!-- padding: 25px 30px; -->
        <!-- 导入导出 -->
        <!-- 无下载模板      回删 -->
        <importXlsx class="importX" :importUrl="importUrl" />
        <!-- 右侧搜索组件 -->
        <rightButtons class="buttons" style="float: right; padding: 10px" @sunS_F="sunS_F" @emptySearch="emptySearch" @configuration="configuration"></rightButtons>
        <!-- -------------------- -->
        <!-- <div class="buttons" style="float:right;padding:10px;"> -->
        <!-- <el-button
            type="primary"
            size="mini"
            plain
            @click="sunS_F"
            icon="el-icon-search"
          >搜索</el-button> -->
        <!-- </div> -->
      </div>
    </div>
    <div class="out">
      <!--数据列表-->
      <!-- 字典 -->
      <dictionaries :searchData="searchData" :modelType="modelType" @optionData="dictionariesCallBack"></dictionaries>
      <el-table ref="multipleTable" :data="dataAttribute" v-loading.body="false" border fit highlight-current-row size="mini" :cell-style="{ padding: '5px 0' }" @selection-change="handleSelectionChange">
        <el-table-column align="center" type="selection" :show-overflow-tooltip="true" width="55"></el-table-column>
        <!-- 数据列遍历 -->
        <el-table-column align="center" v-for="(item, index) in searchData" v-if="item.tableSign" :key="index" :label="item.CN" :show-overflow-tooltip="true">
          <template slot-scope="scope">
            <div v-if="item.EN === 'readingValue'" class="thisReading" @click="okl(scope.$index, scope.row)" style="height: 47px; line-height: 47px">
              <!-- <span v-if="item.EN === 'readingValue'" class="thisReading"> -->
              <!-- {{scope.$index}} -->
              <!-- {{focusIndex == scope.$index}} -->
              <!-- <span>{{scope.row[item.EN]}}</span> -->
              <!-- <span>{{currentId}}</span> -->
              <!-- <span>{{item.id}}{{currentId}}</span> -->
              <el-input v-if="scope.$index === currentId" v-focus v-model="scope.row[item.EN]" size="mini" @blur="inputBlur(scope.$index)" @keyup.enter.native="
                                    inputFoucs(
                                        scope.$index,
                                        scope.row[item.EN],
                                        scope.row.id
                                    )
                                ">
                <!-- @change="handleEdit(scope.$index,scope.row)" -->
                <!-- @keyup.enter.native="inputFoucs(scope.$index,scope.row[item.EN],item.id)" -->
                <!-- v-model="scope.row.readingValue" -->
              </el-input>
              <span v-else>{{ scope.row[item.EN] }}</span>
            </div>

            <span v-else>{{
                            item.type === "select"
                                ? optionDatas(
                                      item.typeGroupCode
                                          ? optionsZi[item.EN]
                                          : searchOptionTable[item.EN],
                                      scope.row[item.EN]
                                  )
                                : scope.row[item.EN]
                        }}</span>
          </template>
          <!-- <template slot-scope="scope">{{scope.row[item.EN]}}</template> -->
          <!-- <template slot-scope="scope">{{scope.row[item.EN]}}</template> -->
        </el-table-column>
      </el-table>
      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="pagetotal"></el-pagination>
    </div>
  </div>
</template>
<script>
//引入组件
import {
  SearchCForL,
  searchComponents,
  buttonhurdle,
  rightButtons,
  dictionaries,
  importXlsx,
} from '@/views/components/FLPage'
import {
  addFlManualReading, //增加
  deleteFlManualReading, //删除
  searchFlManualReading, //分页查询
  modifyFlManualReading, //修改
  getFlManualReading, //根据ID获取
  exprotXls, //导出xlsx数据
  downTem, //导出下载模板
  inputReadNum, //录入读数
} from '@/api/admin/flManualReading/index'
export default {
  components: {
    SearchCForL,
    searchComponents,
    buttonhurdle,
    rightButtons,
    dictionaries,
    importXlsx,
  },
  data() {
    return {
      //搜索框
      suoS: {},
      //瀑布数据
      //   搜索组件的数据
      searchData: [
        {
          EN: 'id',
          CN: '主键',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        // {
        //   EN: "sellingareaCode",
        //   CN: "营业厅",
        //   value: "",
        //   type: "input",
        //   option: [],
        //   Exp: "^.{3,20}$",
        //   err: "长度为3-20的所有字符!",
        //   result: true,
        //   sign: true,
        //   searchSign: true,
        //   addSign: true,
        //   tableSign: true,
        //   examineSign: true,
        //   examineDisabled: false,
        //   modificationSign: true
        // },
        {
          EN: 'areaCode',
          CN: '片区',
          value: '',
          type: 'select',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          dictTable: {
            table: 'fl_area',
            id: 'id',
            name: 'name',
          },
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'watermeterNo',
          CN: '水表编号',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: true,
          addSign: true,
          tableSign: true,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'customerName',
          CN: '客户名称',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: true,
          addSign: true,
          tableSign: true,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'customerNo',
          CN: '客户编号',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: true,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'customerTel',
          CN: '客户电话',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: true,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'hangbookCode',
          CN: '抄表手册id',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'bookName',
          CN: '抄表手册',
          value: '',
          type: 'select',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          isMultiple: true,
          searchSign: true,
          addSign: true,
          tableSign: true,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
          dictTable: {
            table: 'fl_book',
            id: 'id',
            name: 'name',
          },
        },
        {
          EN: 'bookNo',
          CN: '手册编码',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'readingUser',
          CN: '所属人员',
          value: '',
          type: 'select',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          dictTable: {
            table: 'base_user',
            id: 'id',
            name: 'name',
          },
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'watermeterAddress',
          CN: '水表地址',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: true,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'lastReadingValue',
          CN: '上期读数',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: true,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'lastUsing',
          CN: '上期用量',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: true,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'readingValue',
          CN: '本期读数',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: true,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'usingSum',
          CN: '合计用量',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: true,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'watermeterState',
          CN: '水表状态',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: true,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'waterproperty',
          CN: '用水性质',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: true,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'queueNo',
          CN: '序号',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: true,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'jzqId',
          CN: '集中器编号',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'cjqId',
          CN: '采集器编号',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'moduleAddr',
          CN: '模块地址',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'dma',
          CN: 'dma分区',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'lastCbDate',
          CN: '上次抄表日期',
          value: '',
          type: 'date',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'thisCbDate',
          CN: '本次抄表日期',
          value: '',
          type: 'date',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'watMeterAddrCode',
          CN: '表计地址码',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'xq',
          CN: '小区',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'loudongId',
          CN: '楼栋号',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'unitId',
          CN: '单元号',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'roomNumber',
          CN: '门牌号',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'taskStartDate',
          CN: '任务开始日期',
          value: '',
          type: 'date',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: true,
          addSign: true,
          tableSign: true,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'cbStatus',
          // CN: "抄表状态 0未抄，1已抄，2已审核，3已结束",
          CN: '抄表状态',
          value: '',
          type: 'select',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: true,
          addSign: true,
          tableSign: true,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
          typeGroupCode: 'reading_status',
        },
        {
          EN: 'jingDu',
          CN: '经度',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'weiDu',
          CN: '纬度',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'gangYinHao',
          CN: '钢印号',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'readLongitude',
          CN: '抄表人定位经度',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'readLatitude',
          CN: '抄表人定位纬度',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'imgMeterEnv',
          CN: '',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'imgMeterLocation',
          CN: '',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'imgMeterNum',
          CN: '',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'taskId',
          CN: '所属任务id',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'type',
          CN: '水表类型 1手动抄表，5抄表机抄表',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'channelNumber',
          CN: '通道号',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'jxCbjProtocol',
          CN: '捷先抄表机协议',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'watermeterRange',
          CN: '水表量程',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
        {
          EN: 'machineType',
          CN: '',
          value: '',
          type: 'input',
          option: [],
          Exp: '^.{3,20}$',
          err: '长度为3-20的所有字符!',
          result: true,
          sign: true,
          searchSign: false,
          addSign: true,
          tableSign: false,
          examineSign: true,
          examineDisabled: false,
          modificationSign: true,
        },
      ],
      //添加弹窗的数据模型
      diaDataAdd: {
        yyqName: '',
        pqName: '',
        pqNum: '',
        BH: '',
      },
      //删除----Start----------------------------------------
      deleteDataList: [],
      //删除----End----------------------------------------

      //查看----Start----------------------------------------
      //查看的弹窗控制器
      DialogVisibleExamine: false,
      //查看的数据
      examineData: {},
      //查看----End----------------------------------------

      //表格数据
      //后端传来的数据
      dataAttribute: [],
      //表格选中
      multipleSelection: [],
      //分页
      currentPage: 1, //当前页
      pagesize: 10, //每页条数
      pagetotal: 0, //总条数
      // 导入的请求地址
      importUrl: `/api/cb/flManualReading/importXls`,
      modelType: 'table',
      optionsZi: [],
      searchOptionTable: [],
      focusIndex: -1,
      currentLineIndex: -1,
      inputOpenOrClose: false,
      // 当前选中的单元格  行的id
      currentId: -1,
    }
  },
  computed: {
    // 字典
    optionDatas() {
      return function (arr, val) {
        //console.log(arr[val],'why');
        if (arr) {
          //console.log(arr[val], val)
        }
        if (arr) {
          for (let i = 0; i < arr.length; i++) {
            if (arr[i].value == val) {
              // console.log(arr[i].label)
              return arr[i].label
            }
          }
        }
      }
    },
  },
  directives: {
    focus: {
      // 指令自定义   自动获取焦点
      inserted: function (el) {
        console.log(el.children[0].focus())
        // el.children[0].focus();
      },
    },
  },
  created() {
    this.forData(this.currentPage, this.pagesize, this.suoS)
  },
  methods: {
    // 配置
    configuration(msg) {
      if (msg == '配置') {
        console.log(msg)
      }
    },
    // 重置
    emptySearch(msg) {
      if (msg == '重置') {
        this.searchContent = undefined
        // this.forData(this.currentPage, this.pagesize);
      }
    },
    clickFocus(row, column, cell, event) {
      // console.log(cell,event,89889);
      console.log(row, column, cell, event, 89889)
      // 当前选中的id
      this.currentId = row.$index
    },
    // 改变抄表状态
    async changeStatus(row, readNum) {
      const res = await inputReadNum(row, readNum)
      if (res.code === 20001) {
        this.$message({
          message: res.message,
          type: 'warning',
        })
        return false
      }
      return true
      console.log(res)
    },
    inputBlur(index) {
      if (index === this.currentId) this.currentId = -1
    },
    async inputFoucs(index, readNum, id) {
      console.log(index, readNum, 888, id)
      // console.log(this.focusIndex == index,555);
      // this.focusIndex == index
      index = index + 1
      // ---
      const result = await this.changeStatus(id, readNum)
      // 刷新页面
      this.forData(this.currentPage, this.pagesize, this.suoS)
      // ---
      if (!result) return false
      // 刷新页面
      //this.forData(this.currentPage, this.pagesize, this.suoS);

      this.currentId = index > this.pagesize ? -1 : index
      console.log(this.currentId, '下一个选择框的下标')

      this.focusIndex = index
      // console.log(this.focusIndex,'??');
      // 传的参数   当前的行数    此单元格的值

      // this.forData(this.currentPage, this.pagesize, this.suoS);
      // 问题：currentId已经改变   但是下一个input不显示
    },
    // 每一行的index
    okl(index, row) {
      console.log(index, row, 666)

      // focusIndex
      // this.currentLineIndex = index
      this.currentId = index
    },
    // 字典组件回调
    dictionariesCallBack([a = {}, b = {}]) {
      // 正常字典
      this.optionsZi = a
      // 跨表字典
      this.searchOptionTable = b
      // console.log(a,b,66688);
      this.forData(this.currentPage, this.pagesize, this.suoS)
    },
    //搜索
    sunS_F() {
      this.forData(this.currentPage, this.pagesize, this.suoS) //刷新列表
    },
    //查询组件回调
    searchCallBack(newData) {
      console.log(newData)
      //组装数据（newData是个数组）

      let obj = {}
      for (let i = 0; i < newData.length; i++) {
        obj[newData[i].EN] = newData[i].value
      }
      console.log(obj)
      this.suoS = obj
    },
    //渲染数据初始
    forData(page, size, searchData) {
      for (let item in searchData) {
        if (Array.isArray(searchData[item])) {
          searchData[item] = searchData[item].join(',')
        }
      }
      searchFlManualReading(page, size, searchData).then((response) => {
        this.pagetotal = response.data.total
        this.dataAttribute = response.data.list
      })
    },
    //表格选中事件
    handleSelectionChange(val) {
      this.multipleSelection = val
      //传递删除的参数
      this.deleteDataList = val
    },

    //分页
    handleSizeChange(val) {
      console.log('每页 ' + val + ' 条')
      this.forData(this.currentPage, val, this.suoS)
    },
    handleCurrentChange(val) {
      console.log('当前页: ' + val)
      this.forData(val, this.pagesize, this.suoS)
    },
    // 下载模板请求
    exprotXlsx: exprotXls,
    downloadFile: downTem,
  },
  // watch:{
  //   currentId:{

  //   }
  // }
}
</script>
<style scoped src="@/styles/allCss.css"></style>
<style lang="scss" scoped>
.flManualReading {
  .right_row {
    padding: 25px 30px;
  }
  .out {
    // 解决table表格线错位
    /deep/ .el-table--mini {
      .gutter {
        display: table-cell !important;
      }
      .el-table__body-wrapper {
        .el-table__body {
          tbody {
            .el-table__row {
              height: 47px !important;
            }
          }
        }
      }
      .el-input__inner {
        border: 0;
      }
    }
    .el-pagination {
      text-align: left;
      margin-top: 15px;
    }
  }
}
</style>
